{% extends 'TopxiaAdminBundle:CloudSetting:layout.html.twig' %}

{% set submenu = 'key' %}

{% set script_controller = 'setting/cloud-key' %}

{% block maincontent %}
  {% if is_trial() %}
    <div class="row form-group">
      <div class="help-block">
        </br></br>
        <script>
          var _hmt = _hmt || [];
        </script>
        <script charset="utf-8" src="http://wpa.b.qq.com/cgi/wpa.php"></script>

        <p style = "text-align:center;font-size:16px">当前版本为试用版,不能进行更多操作。如需购买授权版,请联系销售人员。电话：0571-86819929 或 
        <span id="BizQQWPA" onclick="_hmt.push(['_trackEvent', 'advisory', 'click', 'qq'])"><a id="BizQQWPA" href="javascript:" style='text-decoration:none;'>QQ：800023860 </a>。</span>
        </p>
        <script type="text/javascript">
            BizQQWPA.addCustom({aty: '0', a: '0', nameAccount: 800023860, selector: 'BizQQWPA'}); 
        </script>
        </br>
      </div>
    </div>
    <hr>
  {% else %}
    {{ web_macro.flash_messages() }}

    <form class="form-horizontal" id="cloud-setting-form" method="post" novalidate>
      <div class="form-group">
        <label class="col-md-3 control-label">AccessKey</label>
        <div class="col-md-6">
          <p class="form-control-static">{{ setting('storage.cloud_access_key') }}</p>
        </div>
      </div>

      <div class="form-group">
        <label class="col-md-3 control-label">SecretKey</label>
        <div class="col-md-6">
          <p class="form-control-static">
            {{ setting('storage.cloud_secret_key') }}
          </p>
        </div>
      </div>

      {% if setting("developer.debug")|default(0) %}
      <div class="form-group">
        <div class="col-md-6 col-md-offset-3">
          <a href="{{ path('admin_setting_cloud_key_update') }}" class="btn btn-sm btn-default">设置新的授权码</a>
          </div>
      </div>
      {% endif %}

      <div class="form-group" id="loading-text">
        <div class="col-md-6 col-md-offset-3">
          <p class="text-warning"><strong>正在读取授权信息，请稍等...</strong></p>
        </div>
      </div>

      <div id="key-license-info" data-url="{{ path('admin_setting_cloud_key_info') }}">
        
      </div>

      <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    </form>
  {% endif %}
{% endblock %}